update package.json: ad scripts:compile#437
update package.json: ad scripts:compile#437XiaoYaoNet wants to merge 1 commit intoclaude-code-best:mainfrom
Conversation
📝 WalkthroughWalkthroughA new ChangesBuild Scripts
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
package.json (1)
48-48: 💤 Low valueConsider adding cross-compilation targets.
Bun supports cross-compilation to different platforms using the
--targetflag (e.g.,--target=linux-x64,--target=darwin-arm64,--target=windows-x64). If you intend to distribute compiled binaries for multiple platforms, consider creating separate scripts or documenting the available targets.📦 Example: Multiple platform targets
"compile": "bun run build.ts; bun build --compile ./dist/cli.js --outfile=ccb", + "compile:linux": "bun run build.ts; bun build --compile ./dist/cli.js --outfile=ccb-linux --target=linux-x64", + "compile:macos": "bun run build.ts; bun build --compile ./dist/cli.js --outfile=ccb-macos --target=darwin-arm64", + "compile:windows": "bun run build.ts; bun build --compile ./dist/cli.js --outfile=ccb-windows --target=windows-x64"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 48, The "compile" npm script currently runs "bun build --compile ./dist/cli.js" without cross-compilation targets; add explicit target variants by creating separate scripts (e.g., "compile:linux-x64", "compile:darwin-arm64", "compile:windows-x64") that invoke the same command with --target=<platform> and optionally a combined "compile:all" that runs them in sequence, so update the package.json "compile" scripts block to include these new target-specific entries referencing the existing compile invocation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 48: The "compile" npm script in package.json currently runs "bun build
--compile ./dist/cli.js" without specifying an output file; update the "compile"
script to add a --outfile argument so the compiled binary path is explicit
(e.g., --outfile ./dist/ccb or match the package "bin" name "ccb"); edit the
"compile" script entry to include --outfile with the desired executable name to
ensure the built binary is placed predictably.
---
Nitpick comments:
In `@package.json`:
- Line 48: The "compile" npm script currently runs "bun build --compile
./dist/cli.js" without cross-compilation targets; add explicit target variants
by creating separate scripts (e.g., "compile:linux-x64", "compile:darwin-arm64",
"compile:windows-x64") that invoke the same command with --target=<platform> and
optionally a combined "compile:all" that runs them in sequence, so update the
package.json "compile" scripts block to include these new target-specific
entries referencing the existing compile invocation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| "build:vite": "vite build && bun run scripts/post-build.ts", | ||
| "build:vite:only": "vite build", | ||
| "build:bun": "bun run build.ts", | ||
| "compile": "bun run build.ts; bun build --compile ./dist/cli.js", |
There was a problem hiding this comment.
Specify --outfile for the compiled binary.
The bun build --compile command should include an --outfile parameter to explicitly control where the compiled binary is written. Without it, the output location is ambiguous and may vary across Bun versions.
🔧 Proposed fix to add --outfile
- "compile": "bun run build.ts; bun build --compile ./dist/cli.js",
+ "compile": "bun run build.ts; bun build --compile ./dist/cli.js --outfile=ccb",This will generate a standalone executable named ccb that matches the primary bin entry. Adjust the name as needed (e.g., ccb-compiled or claude-code-best).
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "compile": "bun run build.ts; bun build --compile ./dist/cli.js", | |
| "compile": "bun run build.ts; bun build --compile ./dist/cli.js --outfile=ccb", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 48, The "compile" npm script in package.json currently
runs "bun build --compile ./dist/cli.js" without specifying an output file;
update the "compile" script to add a --outfile argument so the compiled binary
path is explicit (e.g., --outfile ./dist/ccb or match the package "bin" name
"ccb"); edit the "compile" script entry to include --outfile with the desired
executable name to ensure the built binary is placed predictably.
|
我们通过 vite 进行构建, 不使用 bun 构建 |
update package.json: ad scripts: compile:
"compile": "bun run build.ts; bun build --compile ./dist/cli.js",
Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit